package com.rede.didiok.user.modulelist.pay.service;

import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.rede.didiok.common.dto.pay.PayOrderDto;
import com.rede.didiok.common.service.SuperService;
import com.rede.didiok.user.modulelist.pay.entity.PayOrderEntity;

/**
 * 支付订单服务类
 *
 * @author 陌溪
 * @since 2023年4月25日22:21:22
 */
public interface PayOrderService extends SuperService<PayOrderEntity> {

    /**
     * 分页获取列表
     *
     * @param payOrderVO
     * @return
     */
    IPage<PayOrderEntity> getPageList(PayOrderDto payOrderVO);

    /**
     * 分页获取列表
     *
     * @param payOrderVO
     * @return
     */
    IPage<PayOrderEntity> listMyOrder(PayOrderDto payOrderVO);

    /**
     * 分页获取列表
     *
     * @param payOrderVO
     * @return
     */
    IPage<PayOrderEntity> listOrderOfMyRankMember(PayOrderDto payOrderVO);

    /**
     * 获取订单详情
     *
     * @param payOrderVO
     * @return
     */
    PayOrderEntity getOrderDetail(PayOrderDto payOrderVO);

    /**
     * 获取支付订单数
     *
     * @param payOrderVO
     * @return
     */
    int getPayOrderCount(PayOrderDto payOrderVO);

    /**
     * 获取支付订单数
     *
     * @param payOrderVO
     * @return
     */
    int getPayOrderSumFee(PayOrderDto payOrderVO);

    /**
     * 校验某商品是否支付
     *
     * @param productUid
     * @return
     */
    boolean checkWhetherPay(String productUid, String orderUid);

    /**
     * 活动主办方取消某人报名
     * @param payOrderVO
     * @return
     */
    boolean organizerCancelOrder(PayOrderDto payOrderVO);

    /**
     * 查询当前活动的领队报名人数
     * @param resourceUid
     * @return
     */
    Integer getLeaderNumByResourceUid(String resourceUid);

    /**
     * 查询当前活动的报名人数
     * @param resourceUid
     * @return
     */
    Map<String, Object> getApplyUserNumByResourceUid(String resourceUid);

    /**
     * 查询当前活动的报名人数
     * @param resourceUid
     * @return
     */
    List<String>  cancelPayOrderByResourceUid(String resourceUid, String organizerUserUid);

    /**
     * 将支付的费用原路退回，如退还失败，返回订单号
     * @param payOrderEntity
     */
    String refundForCancel(PayOrderEntity payOrderEntity);
}
